<template>
    <div>
      <el-tabs v-model="activeName" type="card" @tab-click="handleClick" closable tab-position="top" stretch>
        <el-tab-pane label="测试一" name="/first" closable></el-tab-pane>
        <el-tab-pane label="测试二" name="/second"></el-tab-pane>
        <el-tab-pane label="测试三" name="/thirdly"></el-tab-pane>
      </el-tabs>
      <router-view/>
    </div>
</template>

<script>
    export default {
        name: "Order",
      data() {
        return {
          activeName: this.$route.path
        };
      },
      methods: {
        handleClick(tab, event) {
          this.$router.push(tab.name)
          console.log(tab.name)
          console.log(tab, event);
        },
      },
      created() {
          this.$router.push("/first")
          this.activeName = '/first'
      }
    }
</script>

<style scoped>

</style>
